﻿using System;
using System.Drawing;
using com.fukefu.source;
using com.fukefu.tools;

namespace com.fukefu.info
{
    public abstract class Information
    {
        private ArticleTemplet temp = new ArticleTemplet();
        //网站配置
        protected Site site = null;
        //标题内容
        protected TitleTag ktag = new TitleTag();
        protected TitleExpandKeyword tek = new TitleExpandKeyword();
        //基础函数
        protected Source source = new Source();
        protected Random random = new Random();
        //配置中心
        protected ProductInformation pif = new ProductInformation();
        //检查关键字
        public virtual bool CheckKeyword(Title title)
        {
            return true;
        }
        //设置网站名称
        public Site Site
        {
            set { this.site = value; }
        }
        //登陆
        public virtual bool Login(User user)
        {
            return this.Login(user.Name, user.Pass, "");
        }
        public virtual bool Login(User user, string vcode)
        {
            return this.Login(user.Name, user.Pass, vcode);
        }
        //发布文章
        public InformationResult PostArticle(Title title)
        {
            return this.PostArticle(title.Word, temp.Get(title), "");
        }
        public InformationResult PostArticle(Title title, string vcode)
        {
            return this.PostArticle(title.Word, temp.Get(title), vcode);
        }
        public virtual Image GetFlushCodeImage()
        {
            return null;
        }
        //登陆
        public abstract bool Login(string name, string pass, string vcode);
        //发布文章
        public abstract InformationResult PostArticle(string title, string content, string vcode);
    }
}
